Skip to main content

Prompt your text-to-image AI

Project description

Welcome

Publish to PyPI.org

This is a small module that can be used to generate prompts for text-to-image generative AI.

The package is available on pypi.

In order to install the package you would use the following command.

pip install propmpter-r3ap3rpy

Then all you have to do is import the module and use it as follows.

from prompter import PromptGenerator
p = PromptGenerator()
p()
'Madonna grilling at Jerusalem.'
p()
'Natalie Portman cycling at Mumbai.'
p()
'John von Neumann baseball at Tower of London.'

You have the option to update the data.json.

from prompter import PromptGenerator
p = PromptGenerator()
p.update("People","Dani Ernő")

When updating the data the section is converted to lower-case and verified, also the value is checked whether it's in the section converted to lower-case before checking, if not it's added, otherwise an exception is thrown.

You can also delete from the data.json entries. By default it will delete first occurence from each section, but you can pass the all_occurence=True to remove all occurences.

from prompter import PromptGenerator
p = PromptGenerator()
p.delete("Dani Ernő") # deletes value from every sections
p.delete("people","Pablo Picasso") # deletes value from given section

You have the option to get basic stats from your database.

from prompter import PromptGenerator
p = PromptGenerator()
p.stats
###############################################
#        people        #         107          #
#       activity       #         107          #
#       location       #         107          #
###############################################

The details attribute will print the content in a table format to your terminal.

You have restore_db() which is a static method, it allows you to restore any backups in the data folder, the backup_db() which is an instance method allows you to backup the actual state of the database to a default or custom filename!

In order to run the tests you can do the following.

git clone https://github.com/r3ap3rpy/prompter
cd prompter
pip install -r requirements.txt
pytest -vvvvv

You can also use pylint, currently the passing score is 9,5, the workflow will fail if score goes under it.

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

prompter_r3ap3rpy-0.1.7.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

prompter_r3ap3rpy-0.1.7-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file prompter_r3ap3rpy-0.1.7.tar.gz.

File metadata

  • Download URL: prompter_r3ap3rpy-0.1.7.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for prompter_r3ap3rpy-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8d0acced272e9ba23adef151a3d446eea38d71d6448cacc6acbf001260dd9e0f
MD5 867ab1fedd2dff09cc5381ea688cf420
BLAKE2b-256 aecfdc5ef9838650f84c040938984c7c04c85f5874205ea054f9bde3efa2fc2e

See more details on using hashes here.

File details

Details for the file prompter_r3ap3rpy-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for prompter_r3ap3rpy-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9695dfe75f4200e186e6eee185c8dc65b22a60abcecdaa613b65e415c9b1093a
MD5 5873905e9d3beaa5ce78cdf2dacd7354
BLAKE2b-256 42e25dc132467b307fbb97e7fffd564237fa3532537e89f9b28ac582306d5f48

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