Git Product home page Git Product logo

dumpaddress's Introduction

dumpaddress

Python 3.3+ Supported. No Python 2.x. Sorry.

Command line tool for extracting addresses like urls and email addresses from any text file. Uses the right method for the job:

  • Emails are extracted using string processing instead of regular expressions due to the complexity of RFC 5822.
  • URLs are extracted using a very well designed regex.
  • Links are extracted by parsing the href attribute of tags. You can also supply a value to prepend urls.

Installation

getum isn't in pypi just yet:

  1. git clone [email protected]:indymike/dumpaddress.git
  2. cd dumpaddress
  3. pip3 install .

Usage

$ dumpaddress --help

Gets a list of commands

$ dumpaddress links --help

Gets help for links command

$ dumpaddress urls somefile.txt

returns a list of urls contained in somefile.txt.

$ dumpaddress emails somefile.txt

returns a list of email addresses

$ dumpaddress emails somefile.txt >emails.txt

saves all of the emails in somefile.txt in emails.txt

$ dumpaddress links somefile.html

returns a list of unique links from file

Notes

  • This was written to try out the excellent click command line framework (http://click.pocoo.org/3/).
  • Python 3 only. This does not support Python 2x. Really, let's move on to Python 3 already. It's really worth it.
  • Regular Expressions are useful when they work, but can create very subtle failures. The URL probably has more than one way it will fail to get urls, but it works well enough.
  • email_regex works pretty well. email works a little better but is slower.

Known Issues

  • link extraction just prepends whatever prepend value you give it. It does not currently check if there is an existing domain.

License

This application is licensed under the BSD License.

Authors

dumpaddress's People

Contributors

indymike avatar

Watchers

L3DLP avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.