Giter VIP home page Giter VIP logo

desensitize-cn's Introduction

Desensitize-cn

Desensitize data of finance customer for they compiance with chinese security policy (5 features:name, id, phone, address, card)

  • name: can't show first name,can show last name
  • id: can't show 4-14numbers
  • phone:can't show first 7 numbers
  • address:can't show last address
  • card: just can show last four numbers

Using it in full text process

clean() function would do mask job It include two parameters:

  • text: you processed text
  • replace_with: the replace type:include identifier and compliance

by default, it would process card,cnaddress,cnid,cnname,credential,email,name,phone,url mode, you can use add_detector() or remove_detector() to add or remove mode in it.

import desensitize
de=desensitize.Desensitize()
#de.remove_detector('email')
text=u"13725557496 contact Joe Duffy at [email protected] 370304197709200630 4401250222189922 王猛住在上海市陆家嘴汤臣一品"
de.clean(text)
#['', 'a16a00b1f7d5e4e1b20a5b7517e17463', ' contact ', 'Joe', ' ', 'Duffy', ' at ', '[email protected]', ' ', '370***********0630', ' ', '************9922', ' ', '王*', '住在', '上海市***', '汤臣一品']

Using it in csv process

import pandas as pd
df=pd.read_csv("test.csv")
df = df.applymap(str)
pd.save_csv("test1.csv")

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

desensitize-cn's People

Contributors

amazon-auto avatar leewaylicn avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.