Coder Social home page Coder Social logo

fastly-py's Introduction

Fastly Python Client

fastly-py is available through pip as the fastly package

There are three simple scripts provided in /bin that can be used for various stand-alone purge operations.

Usage

import fastly
api = fastly.API()
api.authenticate_by_key('MYKEY')
api.purge_url('www.example.com', '/some/path')

TODO:

Doc files Docstrings Config file

Running Tests

$ python -m test.api_test

Set up environment configuration

We use Python's os and a .env file to manage environment variables in development and test environments. See the list of required environment variables in the .env.example file in the root directory.

To optionally set values for testing, make a copy of .env.example and name it .env.

cp .env.example .env

# Note:
# If using direnv, you can just use it as a `.envrc` file and not have to `source` it manually.

# Using your favorite editor, update the values of the environment variables in `.env` and then

source .env

Distributing a package

Create a .pypirc file:

$ cat > .pypirc
[distutils]
index-servers =
    pypi

[pypi]
repository: https://upload.python.org/legacy/

Install twine:

$ python3 -m pip install --user --upgrade twine

Create a build:

$ python3 setup.py sdist bdist_wheel

Use twine to publish to Pypi:

$ twine upload dist/* 
Uploading distributions to https://upload.pypi.org/legacy/
Enter your username: [YOUR_USERNAME]
Enter your password:
Uploading fastly-0.2.3-py3-none-any.whl
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.2k/13.2k [00:02<00:00, 6.40kB/s]
Uploading fastly-0.1.3-py2.7.egg
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 17.8k/17.8k [00:01<00:00, 12.8kB/s]
Uploading fastly-0.1.3-py3.6.egg
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 18.3k/18.3k [00:01<00:00, 14.2kB/s]
Uploading fastly-0.2.3.tar.gz
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9.25k/9.25k [00:01<00:00, 9.09kB/s]

Builds and uploads to PyPi. More info on this at the python site. You will need to be granted access to the fastly package in order to push.

fastly-py's People

Contributors

thommahoney avatar blithe avatar tyler avatar psbanka avatar edmund-huber avatar gschorkopf avatar mmay avatar verkaufer avatar tomds avatar sivy avatar justizin avatar dcmoore-gd avatar conorbranagan avatar djworth avatar lanej avatar kshay avatar pedropregueiro avatar everdance avatar

Watchers

Bogdan Anton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.