Generates a Google Maps import file from a Contact Group in Xero
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
tests
xero_map_gen
.coveragerc
.gitignore
.travis.yml
LICENSE
MANIFEST.in
README.md
main.py
requirements-test.txt
requirements.txt
setup.py
tox.ini

README.md

Xero-Map-Generator

Generates a Google Maps import file from a Contact Group in Xero

Build Status Maintainability Test Coverage Known Vulnerabilities Say thanks icon

        _  __    __  ___   ______
       | |/ /   /  |/  /  / ____/
       |   /   / /|_/ /  / / __
      /   |   / /  / /  / /_/ /
     /_/|_|  /_/  /_/   \____/

Coverage

codecoverage-svg-sunburst

Usage

Create a config file with your API credentials

cat > ~/.credentials/xmg_config.json << EOF
{
    "XeroApiConfig":{
        "consumer_key": "XXXXXXXXXX",
        "rsa_key_path": "~/.credentials/privatekey.pem"
    }
}
EOF

Use the instructions for the pyxero API to generate your private application credentials

To Generate a single xml file

xero_map_gen --config-dir ~/.credentials --config-path xmg_config.json --filter-contact-groups 'Support Clients (monthly)'

Create a script if you are generating multiple csv files like so

xero_map_gen --filter-contact-groups 'ACME Agencies|Joli Agencies|KAS Agencies' --filter-states 'NSW|ACT' --dump-path "stockists_nsw_$(date +'%Y-%m-%d').csv" --config-path ~/.credentials/xmg_config.json && \
xero_map_gen --filter-contact-groups 'Foo Agencies'  --filter-states 'QLD' --dump-path "stockists_qld_$(date +'%Y-%m-%d').csv" --config-path ~/.credentials/xmg_config.json && \
xero_map_gen --filter-contact-groups 'Bar Agencies' --dump-path "stockists_vic_$(date +'%Y-%m-%d').csv" --config-path ~/.credentials/xmg_config.json && \
xero_map_gen --filter-contact-groups 'Foobar Agencies' --dump-path "stockists_sa_$(date +'%Y-%m-%d').csv" --config-path ~/.credentials/xmg_config.json && \
xero_map_gen --filter-contact-groups 'Direct' --filter-states 'TAS' --dump-path "stockists_tas_$(date +'%Y-%m-%d').csv" --config-path ~/.credentials/xmg_config.json && \
xero_map_gen --filter-contact-groups 'Direct' --filter-states 'WA' --dump-path "stockists_wa_$(date +'%Y-%m-%d').csv" --config-path ~/.credentials/xmg_config.json && \
xero_map_gen --filter-contact-groups 'Direct' --filter-states 'NT' --dump-path "stockists_nt_$(date +'%Y-%m-%d').csv" --config-path ~/.credentials/xmg_config.json
read -p "Maps Succesfully Generated, press enter to continue"