Skip to main content

HUG

Everyone needs a hug every once in a while. Even API developers. Hug aims to make developing Python driven APIs as simple as possible, but no simpler.

PyPI version PyPi downloads Build Status License

Hug drastically simplifies Python API development.

Hug’s Design Objectives:

  • Make developing a Python driven API as succint as a written definition.

  • The framework should encourage code that self-documents.

  • It should be fast. Never should a developer feel the need to look somewhere else for performance reasons.

  • Writing tests for APIs written on-top of Hug should be easy and intuitive.

  • Magic done once, in an API, is better then pushing the problem set to the user of the API.

Basic Example API

happy_birthday.py

"""A basic (single function) API written using Hug"""
import hug


@hug.get('/happy_birthday')
def happy_birthday(name, age:int, **kwargs):
    """Says happy birthday to a user"""
    return "Happy {age} Birthday {name}!".format(**locals())

To run the example:

hug happy_birthday.py

Then you can access the example from localhost:8080/happy_birthday?name=Hug&age=1 Or access the documentation for your API from localhost:8080/documentation

Why Hug?

HUG simply stands for Hopefully Useful Guide. This represents the projects goal to help guide developers into creating well written and intuitive APIs.


Thanks and I hope you find this hug helpful as you develop your next Python API!

~Timothy Crosley

Download files

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

Source Distribution

hug-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file hug-0.0.1.tar.gz.

File metadata

  • Download URL: hug-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hug-0.0.1.tar.gz
Algorithm Hash digest
SHA256 806e9c81acaa5a421f68217316247228293682747598de3e0abdcbd6c7e25173
MD5 36e3204b5a756921f105285bd1f6d29b
BLAKE2b-256 cbb4b78ed1932e4b291ad155af38e4420e20bfadd955fb7b92eec57f63b27aff

See more details on using hashes here.

Release history Release notifications | RSS feed

2.6.1

2 files

2.6.0

2 files

2.5.6

2 files

2.5.5

2 files

2.5.4

2 files

2.5.3

2 files

2.5.2

2 files

2.5.1

2 files

2.5.0

2 files

2.4.8

2 files

2.4.7

2 files

2.4.6

2 files

2.4.5

2 files

2.4.4

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

1 file

2.4.0

1 file

2.3.2

1 file

2.3.1

1 file

2.3.0

1 file

2.2.0

1 file

2.1.2

1 file

2.1.1

1 file

2.1.0

1 file

2.0.6

1 file

2.0.5

2.0.4

1 file

2.0.3

1 file

2.0.2

1 file

2.0.1

1 file

2.0.0

1 file

1.9.9

1 file

1.9.8

2 files

1.9.7

2 files

1.9.6

2 files

1.9.5

2 files

1.9.4

2 files

1.9.3

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.2

2 files

1.8.1

2 files

1.8.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.5

2 files

1.6.4

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

0.0.3

1 file

0.0.2

1 file

This release

0.0.1 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page