Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of custom delimiter #13

Merged
merged 1 commit into from
Oct 30, 2015

Conversation

adityanatraj
Copy link
Collaborator

When extending the Vlad class, one can now choose to set an attribute called delimiter that will be used when reading the csv source.

It is optional and if it is unset, it will be defaulted to using , as the separator.

here are some examples where the delimiter is set:

class Chocula(Vlad):
    source = LocalFile('...')
    validators = {
        'Column A': [],
        'Column B': []
    }
    delimiter = '|'

or

Vlad(source=LocalFile('...'), validators={}, delimiter='|')

Column A|Column B
Vlad the Impaler|Not A Vampire
Dracula|Vampire
Count Chocula|Vampire
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a Vlad subclass to vladiate/vladiate/examples/vladfile.py which uses this file and the delimiter as well?

@adityanatraj
Copy link
Collaborator Author

updated.

@di
Copy link
Owner

di commented Oct 30, 2015

👍 awesome. Pull request #13, just in time for Halloween, spooky! 🎃 👻

adityanatraj pushed a commit that referenced this pull request Oct 30, 2015
@adityanatraj adityanatraj merged commit 9652d44 into di:master Oct 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants