Skip to main content

Python boilerplate

Project description

ivozzo-pyBoilerplate

A Personal Python Boilerplate

Ever been tired of rewriting the same code for every project?

Well, I do. Or at least, I'm bored of copy pasting the same configuration for some basic functionalities I often use, so I wrote my own boilerplate. Any suggestion (or PR) is obviously welcome!

Usage

Logger class

If you need a logger class using logging with file writing and console appending use this class.

from boilerplate.logger import Logger

# with FileHandler and StreamHandler
logger = Logger(path="insert path here", filename="insert filename here", level="ERROR / WARN / INFO / DEBUG")

# with StreamHandler only
logger = Logger(level="ERROR / WARN / INFO / DEBUG")

logger.info("message")
2021-02-10 08:44:44,086|[MainThread  ]|[INFO ]| message

MongoDatabase class

If you need a Mongo client with some basic functionalities extends this class.

from boilerplate.mongodatabase import MongoDatabase

class MyMongoClient(MongoDatabase):
    def __init__(self, host, user, password, database):
        self.database = super().__init__(host=host, user=user, password=password, database=database)

    def [extensions]

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

ivozzo-pyboilerplate-1.0.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ivozzo_pyboilerplate-1.0.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file ivozzo-pyboilerplate-1.0.0.tar.gz.

File metadata

  • Download URL: ivozzo-pyboilerplate-1.0.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.9.1

File hashes

Hashes for ivozzo-pyboilerplate-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9afb8971ab7537fd4768833a9c19d66c4ca9b350bafa422b4bdeab9b1551f31f
MD5 8a0348cadc2f26038c0e31abd5ff1c5b
BLAKE2b-256 a7b2b352127168c3d351b25c047efa4557c88bd209ad70c5c45bccd4f2613bff

See more details on using hashes here.

File details

Details for the file ivozzo_pyboilerplate-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ivozzo_pyboilerplate-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.9.1

File hashes

Hashes for ivozzo_pyboilerplate-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5381c46f237619d16fd748885f37092d0aac13ffc24a1bb241581d060018d158
MD5 0bbdc362ee92a402f9debb9249edc726
BLAKE2b-256 f8fe42c96234def1b665902b17552d048db115ec903b9aa8ba1a73dec6a5f1f9

See more details on using hashes here.

Supported by

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