Skip to main content

CCCS common python library

Project description

Common python library for CCCS

This is a common library that will be use by our different project so we can re-use as much code as possible. It includes the following:

  • Utility functions
    • Classification engine
    • String manipulation
    • Date manipulation
    • Dictionary flattening/un-flatening/merging
    • Logging setup
    • Networking validation (IP/Domain)
    • Security related operations (Generating password/username/API keys...)
    • Generate random ID
  • Elastic datastore support
    • Maintain connection with Elasticsearch
    • Easy to use lucene base search/add/remove documents functions
    • Maintain indexes fields using predefined data model
    • Perform bulk operations
    • Perform index repair/re-shard/replication/reindex operations
  • Filestore support
    • Provides easy to use file storage for your project with multiple backends
      • HTTP (read only)
      • FTP/SFTP
      • Amazon S3
      • Azure Blob storage
      • Local storage
    • Has the concept of multiple levels of storage
  • Object data model (ODM) support
    • Validate the data of your project
    • Keep the datastore index fields in sync with the model
  • Remote datatypes
    • Provide datastructures accessible to multiple processes running of different machines for distributed high availability environments
    • Supported data structures are the following:
      • Counters
      • Event dispatcher/handlers
      • Hash
      • Global Locks
      • Sets
      • Quota trackers
      • Queues (Pubsub/Fifo/Priority)

Installation

This library is public and distributed via Pypi:

pip install cccs

Development

If you which to participate to the development of this library, you can setup your environment the folowing way.

Install python 3.9+

We only support newer version of python and will not support older versions. This library was meant to end up running in a container anyway.

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9

Install VSCode

This is our prefered IDE and the repo is already preconfigured for it.

sudo snap install code

Clone the cccs_common_python repo into your git folder

cd ~/git/
git clone git@github.com:CybercentreCanada/cccs_common_python.git

Create a virtual env in the cccs_common_python folder

cd ~/git/cccs_common_python/
python3.9 -m venv venv

Install required packages and library in your virtual environement

cd ~/git/cccs_common_python/
source ./venv/bin/activate
pip install -e .

Currently used by

  • Assemblyline [https://github.com/CybercentreCanada/assemblyline]

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

cccs-0.0.6.tar.gz (104.4 kB view details)

Uploaded Source

Built Distribution

cccs-0.0.6-py3-none-any.whl (100.1 kB view details)

Uploaded Python 3

File details

Details for the file cccs-0.0.6.tar.gz.

File metadata

  • Download URL: cccs-0.0.6.tar.gz
  • Upload date:
  • Size: 104.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cccs-0.0.6.tar.gz
Algorithm Hash digest
SHA256 343963c5958fd46e241e52b40ee689f50271cdc24cdd986d7c85dbf7cfd4d028
MD5 c32499befc9d3581b166283040077790
BLAKE2b-256 6c9ebf0c35b6c05a377ded87683fbad2d1086e9249740f0a527723ce230714e4

See more details on using hashes here.

File details

Details for the file cccs-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: cccs-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 100.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cccs-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a280a9103a55517fc8358a20e25893db8e78c79478eaa31c73a2598d63a8743c
MD5 ed74493c5ec8f996bbd2c6cfbc90d105
BLAKE2b-256 bf97c882f881ada75b5975ea22b52256034e627f2a9a4e78d0ad614b5e6ab93b

See more details on using hashes here.

Supported by

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