Skip to main content

Client and library to interact with Netlify API.

Project description

Python library and simple command line client to interact with Netlify REST API. Tested with Python versions 2.7, 3.5, 3.6, 3.7.

Requires Netlify account with an active authentication token. Visit https://www.netlify.com/docs/cli/#authentication for more information.

Install

PyNetlify is available to install from PyPI:

pip install pynetlify

Use as a command line client

Configure by setting your personal Netlify authentication token to pynetlify.ini file at current working directory. Example pynetlify.ini:

[netlify]
auth-token = <personal-authentication-token>

Create a new site

python -m pynetlify create_site

Deploy folder to a site

python -m pynetlify deploy_folder --site-id <site-id> <folder-to-deploy>

List sites

python -m pynetlify list_sites

Delete site

python -m pynetlify delete_site <site-id>

Print command line help

python -m pynetlify --help

Print help for specific subcommand

python -m pynetlify <subcommand> --help

Use as a Python library

Import and create APIRequest object.

from pynetlify import pynetlify
api_request = pynetlify.APIRequest('auth_token')

Create site.

newly_created_site = api_request.create_site({'name': 'newly-created-site'})

See pynetlify.py source for more.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynetlify-0.1.1.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

pynetlify-0.1.1-py3-none-any.whl (20.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page