|
1 | 1 | # domains2idna |
2 | 2 |
|
3 | | -## A tool to convert a domain or a file with a list of domain to the famous IDNA format. |
| 3 | +## The tool to convert domains to the famous IDNA format. |
| 4 | + |
| 5 | +[](https://travis-ci.com/funilrys/domain2idna) [](https://coveralls.io/github/funilrys/domain2idna?branch=dev) [](https://github.com/funilrys/domain2idna/blob/dev/LICENSE) [](https://github.com/funilrys/domain2idna/releases/latest) [](https://github.com/ambv/black) |
| 6 | + |
| 7 | +The objective of this project is to provide a tool for list or hosts file maintainer that can convertible domain to the Punycode/IDNA format. |
4 | 8 |
|
5 | 9 | * * * |
6 | 10 |
|
7 | | -# Tests |
| 11 | +## Documentation as the place to be! |
8 | 12 |
|
9 | | -```shell |
10 | | -# The following run the tests. |
11 | | -$ python setup.py test |
12 | | -``` |
| 13 | +Want to know more about **domain2idna**? |
| 14 | +We invite you to read the documentation at https://domain2idna.readthedocs.io! |
13 | 15 |
|
14 | | -# Installation |
| 16 | +Want a local copy!? We get you covered! |
15 | 17 |
|
16 | | -You can install domain2idna with two ways. |
| 18 | +Simply run the following and enjoy the documentation! |
17 | 19 |
|
18 | | -```shell |
19 | | -# This install domain2idna without having to manually clone the repository |
20 | | -$ pip install git+https://github.com/funilrys/domain2idna.git#egg=domain2idna |
21 | 20 | ``` |
22 | | - |
23 | | -```shell |
24 | | -# This install all dependencies along with domain2idna after you cloned the repository. |
25 | | -# Usage: developement only. |
26 | | -$ pip install -e . |
| 21 | +$ # We move to the docs directory |
| 22 | +$ cd docs/ |
| 23 | +$ # We build the documentation |
| 24 | +$ make html |
| 25 | +$ # We run the documentation with our favorite browser. |
| 26 | +$ chromium _builld/html/index.html |
27 | 27 | ``` |
28 | 28 |
|
29 | | -# Usage |
30 | | - |
31 | | -## Import |
32 | | - |
33 | | -```python |
34 | | -#!/usr/bin/env python3 |
35 | | - |
36 | | -""" |
37 | | -This module uses domains2idna to convert a given domain. |
| 29 | +## Main Features |
38 | 30 |
|
39 | | -Author: |
40 | | - Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom |
| 31 | +- Read a given domain and convert it to the Punycode/IDNA format. |
| 32 | +- Read a file and convert all non-commented line to the Punycode/IDNA format. |
| 33 | +- Print the converted data on the screen. |
| 34 | +- Save into a file the converted data. |
| 35 | +- Return the converted data (when used as a module). |
| 36 | +- Ignore commented inputs (starts with `#`) |
41 | 37 |
|
42 | | -Contributors: |
43 | | - Let's contribute to this example!! |
| 38 | +## Supporting the project |
44 | 39 |
|
45 | | -Repository: |
46 | | - https://github.com/funilrys/domain2idna |
47 | | -""" |
| 40 | +[domain2idna](https://github.com/funilrys/domain2idna), [PyFunceble](https://github.com/funilrys/PyFunceble), [Dead-Hosts](https://github.com/dead-hosts), [Funceble](https://github.com/funilrys/funceble) and all other analog projects are or were powered by :coffee:! |
48 | 41 |
|
49 | | -from colorama import Style |
50 | | -from colorama import init as initiate |
| 42 | +This project helps you and or you like it? |
51 | 43 |
|
52 | | -from domain2idna.core import Core |
| 44 | +[](https://www.paypal.me/funilrys/) |
53 | 45 |
|
54 | | -DOMAINS = [ |
55 | | - "bittréẋ.com", "bịllogram.com", "coinbȧse.com", "cryptopiạ.com", "cṙyptopia.com" |
56 | | -] |
| 46 | +## License |
57 | 47 |
|
58 | | -# We activate the automatical reset of string formatting |
59 | | -initiate(True) |
60 | | - |
61 | | -# The following return the result of the whole loop. |
62 | | -print( |
63 | | - "%sList of converted domains:%s %s" |
64 | | - % (Style.BRIGHT, Style.RESET_ALL, Core(DOMAINS).to_idna()) |
65 | | -) |
66 | | - |
67 | | -# The following return the result of only one element. |
68 | | -print( |
69 | | - "%sString representing a converted domain:%s %s" |
70 | | - % (Style.BRIGHT, Style.RESET_ALL, Core(DOMAINS[-1]).to_idna()) |
71 | | -) |
72 | 48 | ``` |
73 | | - |
74 | | -## Command-Line |
75 | | - |
76 | | - usage: domain2idna [-h] [-d DOMAIN] [-f FILE] [-o OUTPUT] |
77 | | - |
78 | | - domain2idna - A tool to convert a domain or a file with a list of domain to |
79 | | - the famous IDNA format. |
80 | | - |
81 | | - optional arguments: |
82 | | - -h, --help show this help message and exit |
83 | | - -d DOMAIN, --domain DOMAIN |
84 | | - Set the domain to convert. |
85 | | - -f FILE, --file FILE Set the domain to convert. |
86 | | - -o OUTPUT, --output OUTPUT |
87 | | - Set the file where we write the converted domain(s). |
88 | | - |
89 | | - Crafted with ♥ by Nissar Chababy (Funilrys) |
| 49 | +MIT License |
| 50 | +
|
| 51 | +Copyright (c) 2018 Nissar Chababy |
| 52 | +
|
| 53 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 54 | +of this software and associated documentation files (the "Software"), to deal |
| 55 | +in the Software without restriction, including without limitation the rights |
| 56 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 57 | +copies of the Software, and to permit persons to whom the Software is |
| 58 | +furnished to do so, subject to the following conditions: |
| 59 | +
|
| 60 | +The above copyright notice and this permission notice shall be included in all |
| 61 | +copies or substantial portions of the Software. |
| 62 | +
|
| 63 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 64 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 65 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 66 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 67 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 68 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 69 | +SOFTWARE. |
| 70 | +``` |
0 commit comments