Skip to main content

Generates beautiful urls similar to Gfycat.

Project description

[![Build Status](https://drone.shadowmail.co.uk/api/badges/hintofbasil/Python-Beautifurl/status.svg)](https://drone.shadowmail.co.uk/hintofbasil/Python-Beautifurl)

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: beautifurl-0.1.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for beautifurl-0.1.3.tar.gz
Algorithm Hash digest
SHA256 12c52c9ff4b3ede40e2f237e93057c4b56bf23cf2466ed1c159daf5f25eab90e
MD5 fb449e126b27c5d927cb567d7d8aade6
BLAKE2b-256 d26e3a169e6b440fb49a66427a5f7e436bd00a491330463b7d7bb370d770f578

See more details on using hashes here.

File details

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

File metadata

  • Download URL: beautifurl-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for beautifurl-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 63f3e186d3fb4b5d5147b5937b4c58ac4683aca8f8b27f938189e2928b0a6c6d
MD5 fbdc6f3c07e85f7778c90821d4813428
BLAKE2b-256 eae9ecdd2c2efc8ad5e58f1fb8e5ca2d36f78669fd383e716697f03ab2a4fe93

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