A simple package to help code Python easier.
Project description
NateDhaliwal-Package
This is a package that allows Python functions to be used better, with less lines of code.
Installation
To install this package, enter this command line:
pip install natedhaliwal
This package allows you to type in colour by specifying the name of the colour as one of its many functions.
The program displays the text in the specified colour, which is red, in this case. At the end of the line, the program removes any effects that may continue onto the next line.
With natedhaliwal
, you can also open, create, read, overwrite and add data to and from the file.
You can allow the program to wait a specified number of seconds, clear the console or output, generate a random number in the specified range, pick a random item from the specified list, and even scrape websites as well!
In addition, you may convert JSON data, and vice-versa. Perfect for dealing with large JSON files!
Examples of code
Functions
display(text, colour)
: Displays text in the output, with an optional color or effect feature. If the colour field is left empty, it acts like a normalprint()
statement.The list of colours/effects are:
- Bold
- Italic
- Underline
- Red
- Pink
- Yellow
- Green
- Blue
- Purple
- Grey
clear()
: Clears the output screen.randnum(start, end)
: Gets a random number from the range given.randomList(listName)
: Picks a random value from a provided list.wait(seconds)
: Pauses the program for the specified number of seconds.scrape(website_url)
: Scrapes the given website and returns the data in JSON format.jsontodict(json_data)
: Converts JSON data to a dictionary.dicttojson(dict_data)
: Converts a dictionary to JSON.overwritefile(filename, data)
: Writes the data to the specified file and removes previous data.writefile(filename, data)
: Adds the data to the specified file.createfile(filename)
: Creates a new file with the specified name.readfile(filename)
: Reads the specified file and returns the data.
More coming soon!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file natedhaliwal-1.1.0.tar.gz
.
File metadata
- Download URL: natedhaliwal-1.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e07de6e3a2d81f5b65a304270bb2508d90c16f8c1e26f4b46c62723f84ce396 |
|
MD5 | 9c8566d53a079759982ed6001ac67856 |
|
BLAKE2b-256 | d28de2158d0057fdda469084d6d35f44ea72c2b5e1ccd6043fd9f76d2784314f |
File details
Details for the file natedhaliwal-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: natedhaliwal-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0120b11383e3a542e02199dfae9fa7d4ade9474072a43b1c27ef23dacedae2e |
|
MD5 | 8c431cede9eb07d2179b894c3be160e4 |
|
BLAKE2b-256 | c601eaa7bc772d4926aae0dc106b287b9b542bc51c070d513fc385b33558b3b7 |