Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for pynetlify, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pynetlify-0.1.1-py3-none-any.whl (20.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pynetlify-0.1.1.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page