Skip to main content

Credito


Credito is a program to make instant credits in any Python app.

pip install credito


License

This project is licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE for details.


Documentation

Install with:

pip3 install credito pip install credito

Configure and Use credito:

1. Import and Configure the Module:

You can import credito from the credito package and configure it with the path to your custom credits.cfg file. If you don’t specify a path, the default credits.cfg file included in the package will be used.

from credito import Credito

# Create an instance of Credito
credito = Credito()

# If you put nothing in the brackets then it will
# automatically use the default credits.cfg file included in the package.
credito.config()
# Or,
# Configure with a custom credits.cfg file
credito.config('path/to/your/custom/credits.cfg')

2. Start the Handler:

To start listening for the key combination (CTRL + O) and display the credits, you can call the handler function.

credito.handler()

3. Run the Module:

To have credito run in the background and listen for the key combination, you can run it as a standalone script or integrate it into your application.

If running as a standalone script, you can simply execute:

python -m credito

Or, integrate it into your application by calling the handler function as shown above.


How the Printing Works:

1. Configuration (credito.config):

  • When you call credito.config("path/to/custom/credits.cfg"), it loads the content of the credits.cfg file into memory by reading it and storing the content in the self.credits variable.
  • If you don't pass a path to the config function, it will use the default credits.cfg file included in the package.

2. Keypress Handler(handler):

  • When the CTRL + O key combination is detected by the listen_for_keypress function, it triggers the handler() function. The handler() function, in turn, calls credito.show_credits().

3. Displaying Credits (show_credits):

  • Inside show_credits(), the console is cleared using os.system('cls' if os.name == 'nt' else 'clear'), and then the content of self.credits (which contains the content from credits.cfg) is printed.
  • The program pauses for 10 seconds (time.sleep(10)), allowing the user to see the credits, and then it optionally clears the screen again.

Additional Notes

Running in Background:

  • The listen_for_keypress function runs in a separate thread, so the main program remains responsive. Make sure to handle this appropriately in your application.

No cross platform:

  • Don't ask me to add cross platform. I am way too busy to be doing that. It might work cross platform it's just I can't test it and it might not be reliable. Credito was made to work for Windows only. The example provided is tailored for Windows using ctypes. If you need cross-platform support, you may need to use different libraries or methods to handle global keypress events on other operating systems.

Permissions:

  • Capturing global keypresses might require administrative or elevated permissions depending on the system and environment.

Credits printing:

  • Credito will print everything in the credits.cfg file. The credits.cfg file is like a text document for Credito. Make sure the file has the content you want to display, and that it is correctly loaded into the config using the method shown in the documentation above. The Credits will allways be visible for 10 seconds, then either the console will clear again, or the terminal application will resume as normal.

What is the default/auto config?

Thank you for using our application!

Credits:
- Developer: Your Name
- Support: support@example.com

Enjoy using our software!
  • I chose this so it could be a template for easy testing. You are free to copy and change the default/auto config.

Directory Structure:

credito/ - # Base directory
├── credito/ - # Main package folder
│   ├── __init__.py - # Initializes the package
│   ├── credito.py - # Contains the Credito class and logic
│   └── data/ - # Contains seperate info
│       └── credits.cfg - # Default credits file 
├── tests/ - # Tests folder
│   ├── __init__.py - # Can be empty or contain shared fixtures
│   ├── conftest.py - # Global fixtures and hooks for tests
│   ├── test_credito.py - # Unit tests for Credito class
├── README.md - # Project description
├── setup.py - # Setup script for packaging
└── LICENSE - # Obviously just a license

âš¡ Quote
"Talk is cheap. Show me the code."
-- Linus Torvalds --


Metadata

Release files for credito 3.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for credito 3.2.5
File Size Uploaded
credito-3.2.5.tar.gz 18.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for credito 3.2.5
File Interpreter ABI Platform
credito-3.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 36.7 kB

Release files / credito-3.2.5.tar.gz

Download URL credito-3.2.5.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ffb861a37a9f99878320330eceeed0069794e6bbfb5817d537b79eed9da8dffb
BLAKE2b-256 checksum
How to use checksums
eea06eff669bfd91fc905ae43706e8f10358f8b3c6d7d5886d5db8e53e15a6b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Release files / credito-3.2.5-py3-none-any.whl

Download URL credito-3.2.5-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b10a4c7fa836126f1cac3f8673de9a95b3e996f4186d655985bd8b511eb3327
BLAKE2b-256 checksum
How to use checksums
a523324f9b0b862c90366e2aab469ae1f72079bfbd0c7a1788f82447c2e74dba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.1

Release history Release notifications | RSS feed

This release

3.2.5 This release

2 release files

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