API¶
-
class
binstar_client.
Binstar
(token=None, domain=u'https://api.anaconda.org', verify=True, **kwargs)[source]¶ An object that represents interfaces with the Anaconda Cloud restful API.
Parameters: token – a token generated by Binstar.authenticate or None for an anonymous user. -
add_package
(login, package_name, summary=None, license=None, public=True, license_url=None, license_family=None, attrs=None)[source]¶ Add a new package to a users account
Parameters: - login – the login of the package owner
- package_name – the name of the package to be created
- package_type – A type identifier for the package (eg. ‘pypi’ or ‘conda’, etc.)
- summary – A short summary about the package
- license – the name of the package license
- license_url – the url of the package license
- public – if true then the package will be hosted publicly
- attrs – A dictionary of extra attributes for this package
-
add_release
(login, package_name, version, requirements, announce, release_attrs)[source]¶ Add a new release to a package.
Parameters: - login – the login of the package owner
- package_name – the name of the package
- version – the version string of the release
- requirements – A dict of requirements TODO: describe
- announce – An announcement that will be posted to all package watchers
-
download
(login, package_name, release, basename, md5=None)[source]¶ Download a package distribution
Parameters: - login – the login of the package owner
- package_name – the name of the package
- version – the version string of the release
- basename – the basename of the distribution to download
- md5 – (optional) an md5 hash of the download if given and the package has not changed None will be returned
Returns: a file like object or None
-
package
(login, package_name)[source]¶ Get information about a specific package
Parameters: - login – the login of the package owner
- package_name – the name of the package
-
release
(login, package_name, version)[source]¶ Get information about a specific release
Parameters: - login – the login of the package owner
- package_name – the name of the package
- version – the name of the package
-
remove_authentication
(auth_name=None, organization=None)[source]¶ Remove the current authentication or the one given by auth_name
-
remove_release
(username, package_name, version)[source]¶ remove a release and all files under it
Parameters: - username – the login of the package owner
- package_name – the name of the package
- version – the name of the package
-
upload
(login, package_name, release, basename, fd, distribution_type, description=u'', md5=None, size=None, dependencies=None, attrs=None, channels=(u'main', ), callback=None)[source]¶ Upload a new distribution to a package release.
Parameters: - login – the login of the package owner
- package_name – the name of the package
- version – the version string of the release
- basename – the basename of the distribution to download
- fd – a file like object to upload
- distribution_type – pypi or conda or ipynb, etc
- description – (optional) a short description about the file
- attrs – any extra attributes about the file (eg. build=1, pyversion=‘2.7’, os=’osx’)
-
user
(login=None)[source]¶ Get user information.
Parameters: login – (optional) the login name of the user or None. If login is None this method will return the information of the authenticated user.
-
user_packages
(login=None, platform=None, package_type=None, type_=None, access=None)[source]¶ Returns a list of packages for a given user and optionally filter by platform, package_type and type_.
Parameters: - login – (optional) the login name of the user or None. If login is None this method will return the packages for the authenticated user.
- platform – only find packages that include files for this platform. (e.g. ‘linux-64’, ‘osx-64’, ‘win-32’)
- package_type – only find packages that have this kind of file (e.g. ‘env’, ‘conda’, ‘pypi’)
- type – only find packages that have this conda type (i.e. ‘app’)
- access – only find packages that have this access level (e.g. ‘private’, ‘authenticated’, ‘public’)
-