Skip to main content

Generates beautiful urls similar to Gfycat.

Project description

# 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.get_random_url('aaA', camelCase=False)
'foolishjoyoussquirrel'
>>> beautifurl.count_permutations('aaA')
10492819
>>> for url in beautifurl.get_permutations('aaA', shuffle=True):
...     print(url)
...
ScaryJollyEchidna
ScaryJollyPig
ScaryJollyFlamingo
ScaryJollyNewt
ScaryJollyEmu

### 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

> There is currently a bug with the organise script which disallows writing to the read from file. Please use a temporary file as above until this is fixed.

### 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.0.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

beautifurl-0.0.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beautifurl-0.0.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for beautifurl-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2f4ab74c6073c08a2ea5f9b9acd2699108fd03e4beccb7dc1f912e8c3e1445c7
MD5 cb060e00e160d84750fdcebf15ef8f30
BLAKE2b-256 abcfcc2c9c73fb87f45bcdf5315a73087326a2ea89d3c2e7a76c68797abc10ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: beautifurl-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

File hashes

Hashes for beautifurl-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b451f3fa84486a6c3ced2757c5e445add85ec0b0001cb9d613ba84e3ebfbaf
MD5 b02db97f950b35c287417ca9a03fc857
BLAKE2b-256 69ed39507e875cce088b5a6a08ec5e5a047cd982f8fd79c2c5bd3803960c8ab8

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