Skip to content

Commit

Permalink
Merge pull request #2 from dills122/nuget-package
Browse files Browse the repository at this point in the history
Nuget package
  • Loading branch information
dills122 authored Sep 23, 2018
2 parents fe15a61 + 9f8d1d0 commit 2296364
Show file tree
Hide file tree
Showing 16 changed files with 383 additions and 172 deletions.
56 changes: 51 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,47 @@ This functions by adding data annotations/attributes to your transform POCOs.
### Scrubbing Types

* StringAtr
* DoubleAtr (Coming)
* DecimalAtr (Coming)
* IntAtr (Coming)
#### StringAtr

> Available String Scrub Types
* Address
* AddressTwo
* City
* State
* Zip
* Phone
* SSN
* Email
* DOB
* FullName
* LastName
* FirstName
* MiddleName
* UserName



#### DoubleAtr

> Available Double Types
**Coming Soon**

#### DecimalAtr

> Available Decimal Types
**Coming Soon**

#### IntAtr

> Available Integer Types
* Phone
* Zip
* VIN (Coming Soon)
* PIN (Coming Soon)


Example for scrubbing Email
Expand All @@ -37,6 +74,15 @@ public string str {get; set;}

Through reflection this app is able to parse a POCO by properties and find data marked for scrubbing through custom attributes.

> If you have a POCO to map an XML file to you're ready to mark it for scrubbing.
> If you have a POCO then you're all set to start scrubbing personally identifiable information (PII)
> The POCO for translating the file to an object will always be the user's responsibility

### Future

* XML and JSON file Readers
* TPL Dataflow Pipeline for process flow
* Extensive Scrub Types

### **Still a work in progress**
7 changes: 3 additions & 4 deletions ShamWow/Attributes/DecimalAtr.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System;
using ShamWow.Constants;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShamWow.Attributes
{
class DecimalAtr : Attribute
{
private enum DecimalTypes
{
}

public string scrubType { get; private set; }

public DecimalAtr(string scrubType)
Expand Down
6 changes: 2 additions & 4 deletions ShamWow/Attributes/DoubleAtr.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using System;
using ShamWow.Constants;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShamWow.Attributes
{
public class DoubleAtr : Attribute
{
private enum DoubleTypes
{

}
public string scrubType { get; private set; }

public DoubleAtr(string scrubType)
Expand Down
9 changes: 3 additions & 6 deletions ShamWow/Attributes/IntAtr.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using System;
using ShamWow.Constants;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShamWow.Attributes
{
public class IntAtr : Attribute
{
private enum IntTypes
{
Phone,
Zip
}

public string scrubType { get; private set; }

public IntAtr(string scrubType)
Expand Down
35 changes: 22 additions & 13 deletions ShamWow/Attributes/StringAtr.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
using System;
using ShamWow.Constants;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShamWow.Attributes
{
public class StringAtr : Attribute
{
private enum StringTypes
{
Address,
AddressTwo,
Phone,
SSN,
Email,
City,
State,
Zip
}
public string scrubType { get; private set; }
public int length { get; private set; }

public StringAtr(string scrubType)
{
if (CheckAttr(scrubType))
{
this.scrubType = scrubType;
}
}

public StringAtr(string scrubType, int length)
{
if (CheckAttr(scrubType) && length > 0)
{
this.scrubType = scrubType;
this.length = length;
}
}

private bool CheckAttr(string scrubType)
{
StringTypes type;
Enum.TryParse(scrubType, out type);
this.scrubType = scrubType;

if (!Enum.IsDefined(typeof(StringTypes), scrubType))
{
//Not the best fit, but good for now
throw new InvalidOperationException("Not Valid Scrub Type");
}
return true;
}
}
}
37 changes: 37 additions & 0 deletions ShamWow/Constants/ScrubbingType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,41 @@ public enum ScrubTypes
Full,
Marked
}

public enum StringTypes
{
Address,
AddressTwo,
City,
State,
Zip,
Phone,
SSN,
Email,
DOB,
FullName,
LastName,
FirstName,
MiddleName,
UserName
}

public enum IntTypes
{
Phone,
Zip,
VIN,
PIN,

}

public enum DoubleTypes
{

}

public enum DecimalTypes
{

}
}
29 changes: 29 additions & 0 deletions ShamWow/Processor/Factory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using ShamWow.Constants;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShamWow.Processor
{
public class Factory
{
private Func<Object, ScrubTypes, ProcessDocument> _ctorCaller;

public Factory (Func<Object, ScrubTypes, ProcessDocument> ctorCaller)
{
_ctorCaller = ctorCaller;
}

public ProcessDocument Create(object unScrubbedData, ScrubTypes scrubType)
{
if(unScrubbedData != null)
{
return _ctorCaller(unScrubbedData, scrubType);
}
else
{
return null;
}
}
}
}
14 changes: 14 additions & 0 deletions ShamWow/Processor/IProcessDocument.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace ShamWow.Processor
{
public interface IProcessDocument
{
object CleanData();
ProcessDocument Scrub();
bool CheckManifest();
DocumentManifest GetManifest();
}
}
Loading

0 comments on commit 2296364

Please sign in to comment.