Mac Pip Install Regex Running Setup.py Install For Regex ... Error

@twakawl I had problems on Windows 7. The log indicated installing Visual Studio C 14 build tools, which resolved it for me. See here, where upgrading setuptools is also suggested and should be tried first. If the Windows compiler is also the issue for you, then more context and version information here. The point of installing RE2 is to get faster performance with my regx matches. I did all I could do with in python so looking at other options right now. I don't really 'need' to install RE2 - just looking for a better option that can net me some extra speed to hit the time frames I want to hit.

Latest version

Released:

A python script to manage synchronising a local directory of photos with flickr based on an rsync interaction pattern

Project description

# flickr-rsync
> Its like rsync for Flickr!
A python script to manage synchronising a local directory of photos with Flickr based on an rsync interaction pattern.
## Installation
### Via PyPI
Install from the python package manager by
```
$ pip install flickr-rsync
```
### From GitHub repo
Clone the GitHub repo locally
To install globally:
```
$ python setup.py install
```
To install for the current user only:
```
$ python setup.py install --user
```
## Authenticating with Flickr
Two keys are provided by Flickr, an api key and a secret. To make your application aware of these keys there are two methods:
* provide `--api-key` and `--api-secret` arguments to the command line
* create a config file in $HOME/.flickr-rsync.ini with the following entries
```
API_KEY = xxxxxxxxxxxxxxxxxxx
API_SECRET = yyyyyyyyyyyyyy
```
where x's and y's are replaced by the values provided by Flickr.
## Listing files
The `--list-only` flag will print a list of files in the source storage provider, this can either be Flickr by specifying the `src` as `Flickr` or a local file system path. Use `--sort-files` to sort the files alphabetically. This feature is useful for manually creating a diff between your local files and Flickr files.
e.g. List all files in Flickr photo sets
```
$ flickr-rsync flickr --list-only
```
Or List all files in a local folder
```
$ flickr-rsync ~/Pictures --list-only
```
### Tree view vs. csv view
You can change the output from a tree view to a comma separated values view by using `--list-format=tree` or `--list-format=csv`. By default the tree view is used.
e.g. Print in tree format
```
$ flickr-rsync flickr --list-only --list-format=tree
├─── 2017-04-24 Family Holiday
│ ├─── IMG_2546.jpg [70ebf9]
│ ├─── IMG_2547.jpg [3d3046]
│ ├─── IMG_2548.jpg [2f2385]
│ └─── IMG_2549.jpg [d8e946]

└─── 2017-04-16 Easter Camping
├─── IMG_2515.jpg [aabe74]
├─── IMG_2516.jpg [0eb4f2]
└─── IMG_2517.jpg [4fe908]
```
Or csv format
```
$ flickr-rsync flickr --list-only --list-format=csv
Folder, Filename, Checksum
2017-04-24 Family Holiday, IMG_2546.jpg, 70ebf9be4d8301e94c65582977332754
2017-04-24 Family Holiday, IMG_2547.jpg, 3d3046b37ba338793a762ab7bd83e85c
2017-04-24 Family Holiday, IMG_2548.jpg, 2f23853abeb742551043a3514ba4315b
2017-04-24 Family Holiday, IMG_2549.jpg, d8e946e73700b9c2890d3681c3c0fa0b
2017-04-16 Easter Camping, IMG_2515.jpg, aabe74b06c3a53e801893347eb6bd7f5
2017-04-16 Easter Camping, IMG_2516.jpg, 0eb4f2519f6562ff66069618637a7b10
2017-04-16 Easter Camping, IMG_2517.jpg, 4fe9085b9f320a67988f84e85338a3ff
```
## Listing folders
To just list the top level folders (without all the files). use `--list-folders`.
```
$ flickr-rsync ~/Pictures --list-folders
```
## Syncing files
e.g. To copy all files from Flickr to a local folder
```
$ flickr-rsync flickr ~/Pictures/flickr
```
Or to copy all files from a local folder up to Flickr
```
$ flickr-rsync ~/Pictures/flickr flickr
```
You can even copy from a local folder to another local folder
```
$ flickr-rsync ~/Pictures/from ~/Pictures/to
```
Files are matched by folder names and file names. E.g. if you have a Flickr photoset called `2017-04-16 Easter Camping` and a file called `IMG_2517.jpg`, and you are trying to copy from a folder with `2017-04-16 Easter CampingIMG_2517.jpg` it will assume this file is the same and will not try to copy it.
### Will never delete!
`flickr-rsync` will never delete any files, either from Flickr or your local system, it is append only. It will not overwrite any files either, if a file with the same name exists in the same photoset / folder, it will be skipped.
## Filtering
Filtering is done using regular expressions. The following four options control filtering the files:
* `--include=` specifies a pattern that **file names** must match to be included in the operation
* `--include-dir=` specifies a pattern that **folder names** must match to be included in the operation
* `--exclude=` specifies a pattern that **file names** must NOT match to be included in the operation
* `--exclude-dir=` specifies a pattern that **folder names** must NOT match to be included in the operation
Note that filtering by folders is more performant than by file names, prefer folder name filtering where possible.
Also note that exclude filters take preference and will override include filters.
### Root files
Note that filtering does not apply to root files, root files (files in the target folder if local file system, or files not in a photoset on Flickr) are excluded by default. To include them, use `--root-files`.
## Options
All options can be provided by either editing the config file `flickr-rsync.ini` or using the command line interface.
```
usage: flickr-rsync [-h] [-l] [--list-format {tree,csv}] [--list-sort]
[--include REGEX] [--include-dir REGEX] [--exclude REGEX]
[--exclude-dir REGEX] [--root-files] [-n]
[--throttling SEC] [--retry NUM] [--api-key API_KEY]
[--api-secret API_SECRET] [--tags 'TAG1 TAG2'] [-v]
[--version]
[src] [dest]
A python script to manage synchronising a local directory of photos to flickr
positional arguments:
src the source directory to copy or list files from, or
FLICKR to specify flickr
dest the destination directory to copy files to, or FLICKR
to specify flickr
optional arguments:
-h, --help show this help message and exit
-l, --list-only list the files in --src instead of copying them
--list-format {tree,csv}
output format for --list-only, TREE for a tree based
output or CSV
--list-sort sort alphabetically when --list-only, note that this
forces buffering of remote sources so will be slower
--list-folders lists only folders (no files, implies --list-only)
-c, --checksum calculate file checksums for local files. Print
checksum when listing, use checksum for comparison
when syncing
--include REGEX include only files matching REGEX. Defaults to
media file extensions only
--include-dir REGEX include only directories matching REGEX
--exclude REGEX exclude any files matching REGEX, note this takes
precedent over --include
--exclude-dir REGEX exclude any directories matching REGEX, note this
takes precedent over --include-dir
--root-files includes roots files (not in a directory or a
photoset) in the list or copy
-n, --dry-run in sync mode, don't actually copy anything, just
simulate the process and output
--throttling SEC the delay in seconds (may be decimal) before each
network call
--retry NUM the number of times to retry a network call before
failing
--api-key API_KEY flickr API key
--api-secret API_SECRET
flickr API secret
--tags 'TAG1 TAG2' space seperated list of tags to apply to uploaded
files on flickr
-v, --verbose increase verbosity
--version show program's version number and exit
```
### Config and token file discovery
The config file `flickr-rsync.ini` and Flickr token file `flickr-rsync.token` are searched for in the following locations in order:
* `<current working dir>/flickr-rsync.ini`
* `<current working dir>/.flickr-rsync.ini`
* `<users home dir>/flickr-rsync.ini`
* `<users home dir>/.flickr-rsync.ini`
* `<executable dir>/flickr-rsync.ini`
* `<executable dir>/.flickr-rsync.ini`
## Developing
Either install using the 'standalone' method or install in development mode so source files are symlinked
```
$ python setup.py develop
```
Then to uninstall
```
$ python setup.py develop --uninstall
```
## Debugging
Use pdb
```
python -m pdb ./flickr_rsync/__main__.py <parameters>
```
Set a breakpoint
```
b ./flickr_rsync/flickr_storage.py:74
```
Then `c(ontinue)` or `n(ext)` to step over or `s(tep)` to step into.
`l(ist)` to show current line and 11 lines of context.
`p(print)` or `pp` (pretty print) to print a variable. E.g.
```
p dir(photo)
pp photo.__dict__
```
To print all properties of variable photo.
`q(uit)` to exit.
Checkout https://medium.com/instamojo-matters/become-a-pdb-power-user-e3fc4e2774b2
## Deploying
Based on [http://peterdowns.com/posts/first-time-with-pypi.html](http://peterdowns.com/posts/first-time-with-pypi.html)
1. Create a new GitHub release (e.g. v1.1.1)
2. Update `flickr_rsync/_version.py` with the new version number (e.g. 1.1.1)
3. Push to PyPI
```
$ python setup.py sdist upload
```
## Running tests
```
$ python setup.py test -q
```
Or
```
$ python -m unittest discover -s tests -p '*_test.py'
```
## Tips
To list just root files only:
```
$ flickr-rsync flickr --exclude-dir '.*' --root-files --list-only
```
### Videos
Movies should work, but flickr doesn't seem to return the original video when you download it again, it returns a
processed video that may have slightly downgraded quality and will not have the same checksum.
## Troubleshooting
#### I get a Version conflict error with the six python package when installing on my Mac
If you're running Mac OSX El Capitan and you get the following error when running `python setup.py test`
```
pkg_resources.VersionConflict: (six 1.4.1 (/System/Library/Frameworks/Python.fra
mework/Versions/2.7/Extras/lib/python), Requirement.parse('six>=1.9'))
```
Do the following:
```
$ sudo pip install --ignore-installed six
```
More details [https://github.com/pypa/pip/issues/3165](https://github.com/pypa/pip/issues/3165)
#### I get an error 'The Flickr API keys have not been set'
To access Flickr this application needs API keys, go to http://www.flickr.com/services/apps/create/apply to sign up for a free personal API key
#### I get an error 'The Flickr API keys have not been set' but I've set them in my config (ini) file
Getting an error `The Flickr API keys have not been set` but you've set them in the config file? Perhaps the application can't find the config file location. Use `-v` or `--verbose` option to print the location of the config file being used.
#### Why are some files are not being shown in the file list / sync?
By default only media files are included in file listings and sync operations. Media files are defined as `.(jpg jpeg png gif tiff tif bmp psd svg raw wmv avi mov mpg mp4 3gp ogg ogv m2ts)$`. Use `--include=.*` to include all files.
#### I get an error 'The filename, directory name or volume label syntax is incorrect'
If you're seeing an error like this
```
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'C:UsersxxxPictures' --list-only/*.*'
```
Ensure that you are not using single quotes `'` around a folder path in windows, instead use double quotes `'`. e.g.
```
$ flickr-rsync 'C:UsersxxxPictures' --list-only
```
#### When I try list list in a local folder called 'flickr' it lists my remote flickr files
flickr-rsync uses the keyword `flickr` as a src or dest to denote pulling the list from flickr. If you have a folder called flickr, just give it a relative or absolute path make it obvious that it's a file path, e.g.
```
$ flickr-rsync ./flickr --list-only
```
#### If I add tags, they get changed by flickr, e.g. 'extn=mov becomes extnmov'.
Internally flickr removes all whitespace and special characters, so 'extn mov' and 'extn=mov' match 'extnmov'. You can
edit a tag using this URL:
https://www.flickr.com/photos/{username}/tags/{tagname}/edit/
or go here to manage all tags:
https://www.flickr.com/photos/{username}/tags
And in future put double quotes around your tag to retain special characters
## Release notes
### v1.0.5 (21 Mar 2018)
* Support for videos
* Add tag to maintain original extension
### v1.0.4 (2 Nov 2017)
* Improve retry and throttling, now uses exponential backoff
* Use python logging framework, outputs log messages to stderr
### v1.0.3 (16 Sep 2017)
* Flickr converts .jpeg to .jpg extensions, so consider them the same when comparing for sync
## TODO
* Handle nested directories (merge with separator) (apply --include-dir after merging)
* List duplicate files
* Use checksum matching to avoid uploading duplicate files
* Multi-threading - is it needed?
* Webpage for successful Flickr login
* Optimise - why does sort files seem to run faster?!
* Fix duplicate albums issue
* Why does it make 3 api calls for every photo in --list-only --list-sort mode?
* --mirror. Yep, delete photos from target, but don't make it easy
* --init to setup a new .ini file and walk through auth process

Release historyRelease notifications

1.0.5

1.0.4

1.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flickr-rsync, version 1.0.5
Filename, sizeFile typePython versionUpload dateHashes
Filename, size flickr-rsync-1.0.5.tar.gz (20.1 kB) File type Source Python version None Upload dateHashes
Close

Hashes for flickr-rsync-1.0.5.tar.gz

Hashes for flickr-rsync-1.0.5.tar.gz
AlgorithmHash digest
SHA256a77863bcc08513a71c7921d29916231096b5d04e0f2611f9a7f63a6a2038ec06
MD503f686315c6729e72a8a60150b7afb50
BLAKE2-256b312bb0396b30cc09dedd2c940fd394b3ea6121add9991f3a3dccb115beb1b11

In this tutorial, you will learn –

Gesendet von iPhone mit Tapatalk.It was very sexy, though. Propellerhead balance drivers for mac. Focusrite, however, can easily match your needs for an interface. I certainly would agree it’d be sweet to have some Propellerhead gear, but here inBalance isn’t quantified under “practical studio purchase”.Since it’s discontinued I would suggest current available options.

Installing NLTK in Windows

In this part, we will learn that how to make setup NLTK via terminal (Command prompt in windows).

The instruction given below are based on the assumption that you don't have python installed. So, first step is to install python.

Installing Python in Windows:

Step 1) Go to link https://www.python.org/downloads/, and select the latest version for windows.

Note: If you don't want to download the latest version, you can visit the download tab and see all releases.

Step 2) Click on the Downloaded File

Step 3)Select Customize Installation

Step 4) Click NEXT

Step 5) In next screen

  1. Select the advanced options
  2. Give a Custom install location. In my case, a folder on C drive is chosen for ease in operation
  3. Click Install

Step 6) Click Close button once install is done.

Step 7) Copy the path of your Scripts folder.

Step 8) In windows command prompt

  • Navigate to the location of the pip folder
  • Enter command to install NLTK
  • Installation should be done successfully

NOTE: For Python2 use the commandpip2 install nltk

Step 9) In Windows Start Menu, search and open PythonShell

Step 10) You can verify whether the installation is accurate supplying the below command

If you see no error, Installation is complete.

Installing NLTK in Mac/Linux

Installing NLTK in Mac/Unix requires python package manager pip to install nltk. If pip is not installed, please follow the below instructions to complete the process

Step1) Update the package index by typing the below command

Step2) Installing pip for Python 3:

You can also install pip using easy_install.

Now easy_install is installed. Run the below command to install pip

Step3)Use following command to install NLTK

Installing NLTK through Anaconda

Step1) Please install anaconda (which can also be used to install different packages) by visiting https://www.anaconda.com/download/ and select which version of python you need to install for anaconda.

Note: Refer to this tutorial for detailed steps to install anaconda

Step 2)In the Anaconda prompt,

  1. Enter command
  2. Review the package upgrade, downgrade, install information and enter yes
  3. NLTK is downloaded and installed

NLTK Dataset

NLTK module has many datasets available that you need to download to use. More technically it is called corpus. Some of the examples are stopwords, gutenberg, framenet_v15, large_grammarsand so on.

How to Download all packages of NLTK

Step 1)Run the Python interpreter in Windows or Linux

Step 2)

  1. Enter the commands
  1. NLTK Downloaded Window Opens. Click the Download Button to download the dataset. This process will take time, based on your internet connection

NOTE: You can change the download location by Clicking File> Change Download Directory

Step 3) To test the installed data use the following code

['The', 'Fulton', 'County', 'Grand', 'Jury', 'said', ..]

Running the NLP Script

We are going to discuss how NLP script will be executed on our local PC. There are many libraries for Natural Language Processing present in the market. So choosing a library depends on fitting your requirements. Here is the list of NLP libraries.

How to Run NLTK Script

Step1) In your favorite code editor, copy the code and save the file as 'NLTKsample.py '

Code Explanation:

  1. In this program, the objective was to remove all type of punctuations from given text. We imported 'RegexpTokenizer' which is a module of NLTK. It removes all the expression, symbol, character, numeric or any things whatever you want.
  2. You just have passed the regular Expression to the 'RegexpTokenizer' module.
  3. Further, we tokenized the word using 'tokenize' module. The output is stored in the 'filterdText' variable.
  4. And printed them using 'print().'

Step2)In the command prompt

  • Navigate to the location where you have saved the file
  • Run the command Python NLTKsample.py

This will show output as :

['Hello', 'Guru99', 'You', 'have', 'build', 'a', 'very', 'good', 'site', 'and', 'I', 'love', 'visiting', 'your', 'site']