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

> 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.1.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

beautifurl-0.1.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beautifurl-0.1.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.2

File hashes

Hashes for beautifurl-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d80e7851e5c6d3e8ccf61bd9b131617208b67e063933b7a0d348d14913c40818
MD5 236e738279e79170f3197107098b7eaa
BLAKE2b-256 b89a4ed5ab2bb21ea06499506944741850e256b14deaeab7fbf3900a2a97d4cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: beautifurl-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.2

File hashes

Hashes for beautifurl-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11018e79a4feafae75ff6cbcb5736523b45c44033fc1fe987716cfc6fd0a90af
MD5 bae7d7f489931af965759cc819e6d400
BLAKE2b-256 53abbf22f48816cc4fae09685176dd13b8fc60db72a1bfd4317e9bb3f0862a00

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