GithubHelp home page GithubHelp logo

bachya / pyden Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 1.0 80 KB

๐Ÿ“ก A Python API for getting information from the City and County of Denver, CO

License: MIT License

Makefile 1.43% Python 98.57%
city python3 asyncio denver

pyden's Introduction

๐Ÿ“ก pyden: A simple Python API for Denver, CO Data

Travis CI PyPi Version License Code Coverage Maintainability Say Thanks

pyden is a simple library to get data from the city and county of Denver, CO.

PLEASE READ: Version 1.0.0 and Beyond

Version 1.0.0 of pyden makes several breaking, but necessary changes:

  • Moves the underlying library from Requests to aiohttp
  • Changes the entire library to use asyncio
  • Makes 3.6 the minimum version of Python required

If you wish to continue using the previous, synchronous version of pyden, make sure to pin version 0.4.1.

Python Versions

pyden is currently supported on:

  • Python 3.5
  • Python 3.6
  • Python 3.7

However, running the test suite currently requires Python 3.6 or higher; tests run on Python 3.5 will fail.

Installation

 pip install pyden

Usage

pyden starts within an aiohttp ClientSession:

import asyncio

from aiohttp import ClientSession

from pyden import Client


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as websession:
      # YOUR CODE HERE


asyncio.get_event_loop().run_until_complete(main())

To create a client, simply:

import asyncio

from aiohttp import ClientSession

from pyden import Client


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as websession:
      client = Client(websession)


asyncio.get_event_loop().run_until_complete(main())

Trash Schedule

import asyncio

from aiohttp import ClientSession

from pyden import Client


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as websession:
      client = Client(websession)

      # Initialize the trash module:
      await client.trash.init_from_coords(<LAT>, <LON>, "<GOOGLE_API_KEY>")

      # Get the full schedule:
      await client.trash.schedule()

      # ...or get the date of next pickup:
      await client.trash.next_pickup(client.trash.PickupTypes.recycling)


asyncio.get_event_loop().run_until_complete(main())

Contributing

  1. Check for open features/bugs or initiate a discussion on one.
  2. Fork the repository.
  3. Install the dev environment: make init.
  4. Enter the virtual environment: pipenv shell
  5. Code your new feature or bug fix.
  6. Write a test that covers your new functionality.
  7. Run tests and ensure 100% code coverage: make coverage
  8. Add yourself to AUTHORS.md.
  9. Submit a pull request!

pyden's People

Contributors

bachya avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

beilmanmich

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.