You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

persistentidgenerator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

persistentidgenerator

This packages allows creating squential ids for financial entities. It's a fairly simple program that allocates 1 billion ids for each entity.

1.1.5
pipPyPI
Maintainers
1

Sequential ID Generator

This Python program provides a robust solution for generating sequential IDs for various entities. It supports up to a billion IDs per entity with the option to expand further. Additionally, it allows for the deletion and reuse of IDs.

Features

  • ID Allocation: Allocate up to a billion IDs per entity with the option to expand.
  • Entity Selection: Choose from the following entities for ID generation:
    • fx: 1 (fx)
    • prices: 2 (hp)
    • static: 3 (sec)
    • index: 4 (idx)
    • benchmarks: 5 (bmrk)
    • holdings: 6 (hld)
    • portfolio: 7 (por)
    • entity: 8 (ent)
    • other:0 (oth)
  • ID Deletion and Reuse: Option to delete an ID and have it reused.

Installation

Ensure that you have SLITE_DB_PATH environment variable set. If not it'll store in profile and wont be persistent if you have concurrent users.

Usage

It has a class and multiple methods

  • Classes

    • guidgen : All methods of the program are written here
  • Methods

    • generate_id() : Creates the sqlite database for persistent storage
    • drop_id() : Checks if the table exists
    • logger() : Creates new table, if table doesn't exist in database
  • Examples

    • get a unique master id - guidgen.generate_id("fx").masterId
    • get a unique numeric id - guidgen.generate_id("fx").numericId
    • drop a numeric id - guidgen.drop_id(21,"fx")
    • get a log details - guidgen.generate_id("fx").logOuput.stdout_log/stderr_log

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or suggestions, please contact email@debmishra.me.

Keywords

guid

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts