Skip to main content

Generates beautiful urls similar to Gfycat.

Project description

![CI](https://github.com/hintofbasil/Python-Beautifurl/workflows/CI/badge.svg?branch=master)

# BeautifURL

## Installation

BeautifURL can be installed from pip

pip install beautifurl

## Usage

>>> from beautifurl import Beautifurl
>>> beautifurl = Beautifurl()
>>> beautifurl.get_random_url('aaA')
'BeautifulAdventurousGiraffe'
>>> beautifurl.count_permutations('aaA')
9150136
>>> for url in beautifurl.get_permutations('aaA', shuffle=True):
...     print(url)
...

GloriousDeterminedPeafowl NiceSuccessfulJackal DepressedStupidPartridge StormyStrangeGiraffe AngryPleasantMonkey …

### Url format

The examples above have a format string as their first argument. This dictates which types of words the url should be made up of. The examples all use adjective adjective Animal. Any number or combination of keys may be used. A full list of keys is available below.

### Custom dictionaries

The Beautifurl object __init__ function takes an optional parameter dictionaryPath. This allows the default dictionaries to be swapped for user specified dictionaries.

>>> beautifurl = Beautifurl(dictionaryPath='~/dictionaries')

The dictionaries in this folder must be named KEY_… where KEY is a single character. All keys should be unique. Any characters after the underscore are ignored. See dictionaries folder for examples.

## Dictionaries

Key | Description | Size |
— | ———– | —- |
a | Adjectives | 223 |
A | Animals | 211 |

## Contributing

### Wordlists

Additional words and lists may be submitted in pull requests. Please run the new lists through the organise script located in the dictionaries folder.

Please ensure you have permission to use any lists before submitting a pull request. If a license is required please name the license file license.LIST_NAME.

./organise LIST_NAME [MAX_SIZE] > tmp mv tmp LIST_NAME

### Code

Pull requests are more than welcome.

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

beautifurl-0.1.4.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

beautifurl-0.1.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file beautifurl-0.1.4.tar.gz.

File metadata

  • Download URL: beautifurl-0.1.4.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for beautifurl-0.1.4.tar.gz
Algorithm Hash digest
SHA256 cd0306bf45b400f0db2c8d9e1a5803738dad2461ba2ff9ce84f40f49f26b3be5
MD5 d982b7af978797055f5988da470b97b4
BLAKE2b-256 710ed5da4db63f8c7077921ff65cde1f87b85febaaa222ba8fe65445f99b75b2

See more details on using hashes here.

File details

Details for the file beautifurl-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: beautifurl-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for beautifurl-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0b1462d5f7a8c5b1dc8f690972996c7de7e1d2b9f6e874322faacf68ab795e1a
MD5 b1b983c664b129c7c728b52f2bc537fa
BLAKE2b-256 22b973f38817f455d90ca18f5d6c80ac9ad3c3430c9eee74e90a1d0ba6fc1f3f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page