Skip to main content

                    GitHub issues GitHub forks GitHub stars GitHub license Python Python Hits

███████╗██╗███╗   ███╗██████╗ ██╗     ██╗███████╗██╗   ██╗
██╔════╝██║████╗ ████║██╔══██╗██║     ██║██╔════╝╚██╗ ██╔╝
███████╗██║██╔████╔██║██████╔╝██║     ██║█████╗   ╚████╔╝
╚════██║██║██║╚██╔╝██║██╔═══╝ ██║     ██║██╔══╝    ╚██╔╝
███████║██║██║ ╚═╝ ██║██║     ███████╗██║██║        ██║
╚══════╝╚═╝╚═╝     ╚═╝╚═╝     ╚══════╝╚═╝╚═╝        ╚═╝
                 built by @Necrownyx

Simplify Python

This is a python package designed to reduce the need for code to be over-complex by providing one-line solutions to problems.

Features list

  1. Json: Json is a package widely used for data storage.
  2. print: print is used to print to the terminal.
  3. Flask: Flask is a popular library for starting web servers.
  4. Paste: This module allows users to send data to a hastebin site.
  5. Cryptography: This module allows users to encrypt and decrypt files.

More coming soon.

Documentation

This is a section for the documentation for all of the modules in the package.

Json

First import the Json branch of the package with:

            from SimplifyPython import sjson

Then you can choose to create a file with:

            sjson.new(filename)

where filename is either the name of a json file without the .json or a filename with an extension for example data.app.json.

Or if you already have a file you can read it with:

            data = sjson.open(filename)

where filename is either the name of a file. This will set the data variable to be the contents of the json file.

Then when you are finished editing the data you can run:

            sjson.save(data, filename)

where data is the edited data to be put in the json file and filename is either the name of a file.

Print

First import the print branch with:

            from SimplifyPython import sprint

Then to use the package type:

            `sprint.{color}(message)

Where color is a color from the below list and treat message like a normal print command arguments.

  1. red
  2. pink
  3. purple
  4. blue
  5. lightblue
  6. brightblue
  7. green
  8. lightgreen
  9. yellow
  10. orange

This will print in the color of your choice.

Flask

Import the sflask branch with:

            from SimplifyPython import sflask

Then add this one line to start the server:

            sflask.start()

The start() command has an optional parameter for a message on the web page to be pinged.

How to run on a thread.

If you want to run the server on its own thread you can put this in your code:

            sflask.thread().start()

This module of the package can also take a custom message for example:

            sflask.thread("hello, world!").start()

Will output "hello, world!" on the webpage.

How to serve multiple pages.

If you want to serve multiple different pages first create the page use either:

            sflask.create_page(route, message)

with route being the route of the site for example: '/' and message being the message to be served to users or a html file name for example index.html this file must be in the templates directory of your project.

You can loop through this as many times as you want.

Then when you have defined all of the pages for your site run:

            sflask.launch_pages().start()

To run all the sites on a thread or:

            sflask.launch_pages_nothread()

To run the sites on the main thread.

Paste

Import the spaste branch with:

            from SimplifyPython import spaste

Then to send a string to hastebin type:

            spaste.text(string)

The message variable should be the content of the paste after you run it it will print the link to the terminal. A second argument of URL can be given if you would like to paste it on a different site Likely wont work with some sites

Just define the filename of the desired file and let the package do the rest. A second argument of URL can be given if you would like to paste it on a different site _Likely wont work with some sites

If you want to sent a files contents to hastebin.

            spaste.file(filename)

To read hastebin files use.

            spaste.read(url)

Or

            spaste.save(url, filepath)

These are mostly straightforward URL is the Hastebin URL and for the save function filepath is the path of the file to save the data to.

File

Import the sfile branch with:

            from SimplifyPython import sfile

Then to receive files type:

            sfile.receive.start()

This will start a flask server to send the request to. you can use an optional key parameter to specify a key needed in the request for the transfer to be accepted.

Then to send files type:

            sfile.send(url, filepath, key)

For the parameters url is the url of the server setup above, filepath is the path to the file to be transferred, and key is the key for the transfer only use this parameter if a key has been setup above.

To send encrypted files use either:

            sfile.send_encrypted(url, filepath, key)

Or to receive:

            sfile.recive_encrypted(key)

The only difference between the functions above with the variables is key needs to be one generated with the scrypto.generate_key() function.

Cryptography

First import the branch of the package with:

            from SimplifyPython import scrypto

Then to generate a new key type:

            scrypto.generate_key(password, salt)

This function returns a key that is key to using the other functions of this branch with success, i suggest saving this key as a secret variable and removing the generate_key() from your code. If salt is left empty it will generate a random 16 character string to use unless you are an advanced user it should be left blank.

Then to encrypt/decrypt a string.

            scrypto.encrypt(key, input)

To encrypt use the key from before and the input as the string to be encrypted.

            scrypto.decrypt(key, input)

To decrypt use the key from above and the input as the data generated by the above function

Then to encrypt/decrypt a file.

            scrypto.encrypt_file(key, filepath)

To encrypt use the key from before and the filepath as the filepath of the file to be encrypted.

            scrypto.decrypt_file(key, filepath)

To decrypt use the key from above and the filepath as the filepath of the file to be decrypted.

Metadata

Release files for SimplifyPython 0.0.19

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

Source distribution (sdist)

Source distribution for SimplifyPython 0.0.19
File Size Uploaded
SimplifyPython-0.0.19.tar.gz 10.4 kB Details

Built distribution (wheel)

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

Total release size: 19.6 kB

Release files / SimplifyPython-0.0.19.tar.gz

Download URL SimplifyPython-0.0.19.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a3beecc9a7b9be79277df2285b0389c535d745de48d531218f541dc51fda0e0a
BLAKE2b-256 checksum
How to use checksums
f427cc9e44b505358c90ace61b79b400e5cd8cc7442cfd954e7f67ace4d0c3fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / SimplifyPython-0.0.19-py3-none-any.whl

Download URL SimplifyPython-0.0.19-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19a70ffe509cf0e1c6bbed4d5508cdc8d1c1133f2a87447db0f4c39c07b16a05
BLAKE2b-256 checksum
How to use checksums
3ec937ea1383a4576eed25774f02331445fbfb52378345fd41f6591ca8d59041
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.0.19 This release

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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